//
//  signInforCollectionCell2.m
//  doubleEduStudents
//
//  Created by 盛洋 on 2021/1/15.
//  Copyright © 2021 shengYang. All rights reserved.
//

#import "signInforCollectionCell2.h"
#import "signInforctionViewCell3.h"


@interface signInforCollectionCell2 ()<UICollectionViewDelegate,UICollectionViewDataSource>

@end

@implementation signInforCollectionCell2

- (void)awakeFromNib {
    [super awakeFromNib];
    self.collection_backView.delegate = self;
    self.collection_backView.dataSource = self;
    [self.collection_backView registerNib:[UINib nibWithNibName:@"signInforctionViewCell3" bundle:nil] forCellWithReuseIdentifier:@"signInforctionViewCell3"];
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    if (self.imgArr.count > 0) {
        return self.imgArr.count;
    }else{
        return 0;
    }
}

-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
    if (self.imgArr.count > 0) {
        if (self.imgArr.count<7) {
            return CGSizeMake(CollectionView_Width/3, CollectionView_Height/2);
        }else{
            return CGSizeMake(CollectionView_Width/3, CollectionView_Height/3);
        }
    }else{
        return CGSizeMake(0, 0);
    }
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    if (self.imgArr.count > 0) {
        signInforctionViewCell3 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"signInforctionViewCell3" forIndexPath:indexPath];
        [cell.pradise_img sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",self.imgArr[indexPath.row]]] placeholderImage:DefaultImg];
        return cell;
    }else{
        return nil;
    }
}


@end
